﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using FasterWPF;

namespace FasterWPFDemo
{
    public class ExampleUserControl : UserControl
    {
        public ExampleUserControl(string userCtlGuid)
        {
            //InitializeComponent(); XAML removed. Initialize via code-behind.
            
            this.Initialize(ContainerType.DockPanel);
            this.BeginSettings<UserControl>().SetItemBorderColorAndThickness<UserControl>(Brushes.Gray, new Thickness(3)).EndSettings();
            
            this.BeginComposite<UserControl>(userCtlGuid)
                .AddLabel<UserControl>(0, 0, "I am a User Control", Brushes.LightBlue)
                .AddFlatButton<UserControl>(0, 1, double.NaN, double.NaN,
                "Remove this UserControl!", Brushes.Gray, new Thickness(2), Brushes.Silver, new CornerRadius(0), new Thickness(2), new Thickness(3), Brushes.LightSlateGray, Brushes.White,
                (o, ev) => {

                    //Retrieve Action from Global Store on Application object
                    GlobalStoreService.GetFromGlobalStore<Action<object, RoutedEventArgs>>(GlobalStoreService.TabControlGuids.Ten, "RegionOneAction1")(o, (RoutedEventArgs)ev);

                }).EndComposite<UserControl, UserControlArgs>(null);

        }
    }
}
